package com.mew.common.rest.gold;

import com.mew.common.util.DateUtils;
import com.zebra.common.ByteBufUtils;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.ToString;

import java.util.Date;

/**
 * @author dylin
 * @create 2021/5/24
 */
@Data
@ToString
public class TranRecordMessage {
    private String gid;//ID
    private String nickname;//名称
    private Integer vipLevel;//VIP等级
    private Long gold;//金币
    private Date sendDate;//发送时间
    public void write(ByteBuf b){
        ByteBufUtils.writeString(b,gid);
        ByteBufUtils.writeString(b,nickname);
        ByteBufUtils.writeInt(b,vipLevel);
        ByteBufUtils.writeLong(b,gold);
        ByteBufUtils.writeString(b, DateUtils.format(sendDate,"yyyy.MM.dd HH:mm:ss"));
    }
}
